<!DOCTYPE HTML>
<html>
<head>
<title>Gravy Test Page</title>
<script type="text/javascript" src="gravy.js"></script>
<script type="text/javascript" src="gravy-editor.js"></script>
<script type="text/javascript">
function test_gravy() {
	document.getElementById("error").value = "";
	var out_elem = document.getElementById("output")
	var parser = new Gravy.Parser(new Gravy.HTMLDomGenerator(out_elem));
	var tokenizer = new Gravy.Tokenizer();
	parser.parse(tokenizer.tokenize(document.getElementById("input").value));
}

function log_msg(text) {
	document.getElementById("error").value += text + "\n";
}

var previewer = null;
window.onload = function () {
	var out_elem = document.getElementById("output");
	var in_elem = document.getElementById("input");
    previewer = new GravyEditor.Previewer(in_elem, out_elem);
}
</script>
</head>
<body>
<h1>Gravy Test Page</h1>
<h2>Input<h2>
<textarea id="input" rows="15" cols="60"></textarea><br />
<input type="button" value="Run" onclick="test_gravy();"/>
<h2>Log</h2>
<textarea id="error" rows="10" cols="60" readonly="true"></textarea>
<h2>Output</h2>
<div id="output"></div>
</body>
</html>

